#  地图图块逻辑
from sysconf import *


class BlockUnit:
    """

    """

    def __init__(self):
        self.id = 0  # 图块编号
        self.cls = 'static'  # 类别：terrains/items/npc
        self.floor = 0  # 层级
        self.resource_id = ''  # 资源编号
        self.attr = {}  # 其他属性


# 图块数据 由图块id得到
BlockData = {
    "1": {"cls": "terrains", "id": "yellowWall", "canBreak": true},
    "2": {"cls": "terrains", "id": "whiteWall", "canBreak": true},
    "3": {"cls": "terrains", "id": "blueWall", "canBreak": true},
    "4": {"cls": "animates", "id": "star", "noPass": true},
    "5": {"cls": "animates", "id": "lava", "noPass": true},
    "6": {"cls": "terrains", "id": "ice"},
    "7": {"cls": "terrains", "id": "blueShop-left"},
    "8": {"cls": "terrains", "id": "blueShop-right"},
    "9": {"cls": "terrains", "id": "pinkShop-left"},
    "10": {"cls": "terrains", "id": "pinkShop-right"},
    "11": {"cls": "animates", "id": "lavaNet", "noPass": false, "trigger": "passNet"},
    "12": {"cls": "animates", "id": "poisonNet", "noPass": false, "trigger": "passNet"},
    "13": {"cls": "animates", "id": "weakNet", "noPass": false, "trigger": "passNet"},
    "14": {"cls": "animates", "id": "curseNet", "noPass": false, "trigger": "passNet"},
    "15": {"cls": "animates", "id": "blueWater", "noPass": true},
    "16": {"cls": "animates", "id": "water", "noPass": true},
    "20": {"cls": "autotile", "id": "autotile", "noPass": true},
    "21": {"cls": "items", "id": "yellowKey"},
    "22": {"cls": "items", "id": "blueKey"},
    "23": {"cls": "items", "id": "redKey"},
    "24": {"cls": "items", "id": "greenKey"},
    "25": {"cls": "items", "id": "steelKey"},
    "26": {"cls": "items", "id": "bigKey"},
    "27": {"cls": "items", "id": "redJewel"},
    "28": {"cls": "items", "id": "blueJewel"},
    "29": {"cls": "items", "id": "greenJewel"},
    "30": {"cls": "items", "id": "yellowJewel"},
    "31": {"cls": "items", "id": "redPotion"},
    "32": {"cls": "items", "id": "bluePotion"},
    "33": {"cls": "items", "id": "greenPotion"},
    "34": {"cls": "items", "id": "yellowPotion"},
    "35": {"cls": "items", "id": "sword1"},
    "36": {"cls": "items", "id": "shield1"},
    "37": {"cls": "items", "id": "sword2"},
    "38": {"cls": "items", "id": "shield2"},
    "39": {"cls": "items", "id": "sword3"},
    "40": {"cls": "items", "id": "shield3"},
    "41": {"cls": "items", "id": "sword4"},
    "42": {"cls": "items", "id": "shield4"},
    "43": {"cls": "items", "id": "sword5"},
    "44": {"cls": "items", "id": "shield5"},
    "45": {"cls": "items", "id": "book"},
    "46": {"cls": "items", "id": "fly"},
    "47": {"cls": "items", "id": "pickaxe"},
    "48": {"cls": "items", "id": "icePickaxe"},
    "49": {"cls": "items", "id": "bomb"},
    "50": {"cls": "items", "id": "centerFly"},
    "51": {"cls": "items", "id": "upFly"},
    "52": {"cls": "items", "id": "downFly"},
    "53": {"cls": "items", "id": "coin"},
    "54": {"cls": "items", "id": "snow"},
    "55": {"cls": "items", "id": "cross"},
    "56": {"cls": "items", "id": "superPotion"},
    "57": {"cls": "items", "id": "earthquake"},
    "58": {"cls": "items", "id": "poisonWine"},
    "59": {"cls": "items", "id": "weakWine"},
    "60": {"cls": "items", "id": "curseWine"},
    "61": {"cls": "items", "id": "superWine"},
    "62": {"cls": "items", "id": "knife"},
    "63": {"cls": "items", "id": "moneyPocket"},
    "64": {"cls": "items", "id": "shoes"},
    "65": {"cls": "items", "id": "hammer"},
    "68": {"cls": "items", "id": "lifeWand"},
    "69": {"cls": "items", "id": "jumpShoes"},
    "70": {"cls": "items", "id": "sword0"},
    "71": {"cls": "items", "id": "shield0"},
    "72": {"cls": "items", "id": "skill1"},
    "81": {"cls": "terrains", "id": "yellowDoor", "trigger": "openDoor"},
    "82": {"cls": "terrains", "id": "blueDoor", "trigger": "openDoor"},
    "83": {"cls": "terrains", "id": "redDoor", "trigger": "openDoor"},
    "84": {"cls": "terrains", "id": "greenDoor", "trigger": "openDoor"},
    "85": {"cls": "terrains", "id": "specialDoor", "trigger": "openDoor"},
    "86": {"cls": "terrains", "id": "steelDoor", "trigger": "openDoor"},
    "87": {"cls": "terrains", "id": "upFloor", "noPass": false},
    "88": {"cls": "terrains", "id": "downFloor", "noPass": false},
    "89": {"cls": "animates", "id": "portal", "noPass": false},
    "90": {"cls": "animates", "id": "starPortal", "noPass": false},
    "91": {"cls": "animates", "id": "upPortal", "noPass": false},
    "92": {"cls": "animates", "id": "leftPortal", "noPass": false},
    "93": {"cls": "animates", "id": "downPortal", "noPass": false},
    "94": {"cls": "animates", "id": "rightPortal", "noPass": false},
    "101": {"cls": "animates", "id": "crystalUp"},
    "102": {"cls": "animates", "id": "crystalBottom"},
    "103": {"cls": "animates", "id": "fire"},
    "104": {"cls": "animates", "id": "switch"},
    "121": {"cls": "npcs", "id": "man"},
    "122": {"cls": "npcs", "id": "woman"},
    "123": {"cls": "npcs", "id": "thief"},
    "124": {"cls": "npcs", "id": "fairy"},
    "125": {"cls": "npcs", "id": "magician"},
    "126": {"cls": "npcs", "id": "womanMagician"},
    "127": {"cls": "npcs", "id": "oldMan"},
    "128": {"cls": "npcs", "id": "child"},
    "129": {"cls": "npcs", "id": "wood"},
    "130": {"cls": "npcs", "id": "pinkShop"},
    "131": {"cls": "npcs", "id": "blueShop"},
    "132": {"cls": "npcs", "id": "princess"},
    "133": {"cls": "npc48", "id": "npc0"},
    "134": {"cls": "npc48", "id": "npc1"},
    "135": {"cls": "npc48", "id": "npc2"},
    "136": {"cls": "npc48", "id": "npc3"},
    "137": {"cls": "npc48", "id": "npc4"},
    "140": {"cls": "autotile", "id": "autotile4", "noPass": true},
    "141": {"cls": "autotile", "id": "autotile5", "noPass": true},
    "151": {"cls": "autotile", "id": "autotile1", "noPass": true},
    "152": {"cls": "autotile", "id": "autotile2", "noPass": true},
    "153": {"cls": "autotile", "id": "autotile3", "noPass": true},
    "161": {"cls": "terrains", "id": "arrowUp", "noPass": false, "cannotOut": ["left", "right", "down"],
            "cannotIn": ["down"]},
    "162": {"cls": "terrains", "id": "arrowDown", "noPass": false, "cannotOut": ["left", "right", "up"],
            "cannotIn": ["up"]},
    "163": {"cls": "terrains", "id": "arrowLeft", "noPass": false, "cannotOut": ["up", "down", "right"],
            "cannotIn": ["right"]},
    "164": {"cls": "terrains", "id": "arrowRight", "noPass": false, "cannotOut": ["up", "down", "left"],
            "cannotIn": ["left"]},
    "165": {"cls": "terrains", "id": "light", "trigger": "changeLight", "noPass": false},
    "166": {"cls": "terrains", "id": "darkLight", "noPass": true},
    "167": {"cls": "terrains", "id": "ski", "trigger": "ski", "noPass": false},
    "168": {"cls": "terrains", "id": "flower", "noPass": false},
    "169": {"cls": "terrains", "id": "box", "trigger": "pushBox", "noPass": true},
    "170": {"cls": "terrains", "id": "boxed", "trigger": "pushBox", "noPass": true},
    "181": {"cls": "npcs", "id": "wlt"},
    "182": {"cls": "npcs", "id": "wt"},
    "183": {"cls": "npcs", "id": "wrt"},
    "184": {"cls": "npcs", "id": "wl"},
    "185": {"cls": "npcs", "id": "wc"},
    "186": {"cls": "npcs", "id": "wr"},
    "187": {"cls": "npcs", "id": "wlb"},
    "188": {"cls": "npcs", "id": "wrb"},
    "189": {"cls": "npcs", "id": "dlt"},
    "190": {"cls": "npcs", "id": "dt"},
    "191": {"cls": "npcs", "id": "drt"},
    "192": {"cls": "npcs", "id": "dl"},
    "193": {"cls": "npcs", "id": "dc"},
    "194": {"cls": "npcs", "id": "dr"},
    "195": {"cls": "npcs", "id": "dlb"},
    "196": {"cls": "npcs", "id": "drb"},
    "201": {"cls": "enemys", "id": "greenSlime"},
    "202": {"cls": "enemys", "id": "redSlime"},
    "203": {"cls": "enemys", "id": "blackSlime"},
    "204": {"cls": "enemys", "id": "slimelord"},
    "205": {"cls": "enemys", "id": "bat"},
    "206": {"cls": "enemys", "id": "bigBat"},
    "207": {"cls": "enemys", "id": "redBat"},
    "208": {"cls": "enemys", "id": "vampire"},
    "209": {"cls": "enemys", "id": "skeleton"},
    "210": {"cls": "enemys", "id": "skeletonSoilder"},
    "211": {"cls": "enemys", "id": "skeletonCaptain"},
    "212": {"cls": "enemys", "id": "ghostSkeleton"},
    "213": {"cls": "enemys", "id": "zombie"},
    "214": {"cls": "enemys", "id": "zombieKnight"},
    "215": {"cls": "enemys", "id": "rock"},
    "216": {"cls": "enemys", "id": "slimeMan"},
    "217": {"cls": "enemys", "id": "bluePriest"},
    "218": {"cls": "enemys", "id": "redPriest"},
    "219": {"cls": "enemys", "id": "brownWizard"},
    "220": {"cls": "enemys", "id": "redWizard"},
    "221": {"cls": "enemys", "id": "yellowGuard"},
    "222": {"cls": "enemys", "id": "blueGuard"},
    "223": {"cls": "enemys", "id": "redGuard"},
    "224": {"cls": "enemys", "id": "swordsman"},
    "225": {"cls": "enemys", "id": "soldier"},
    "226": {"cls": "enemys", "id": "yellowKnight"},
    "227": {"cls": "enemys", "id": "redKnight"},
    "228": {"cls": "enemys", "id": "darkKnight"},
    "229": {"cls": "enemys", "id": "blackKing"},
    "230": {"cls": "enemys", "id": "yellowKing"},
    "231": {"cls": "enemys", "id": "greenKing"},
    "232": {"cls": "enemys", "id": "blueKnight"},
    "233": {"cls": "enemys", "id": "goldSlime"},
    "234": {"cls": "enemys", "id": "poisonSkeleton"},
    "235": {"cls": "enemys", "id": "poisonBat"},
    "236": {"cls": "enemys", "id": "steelRock"},
    "237": {"cls": "enemys", "id": "skeletonPriest"},
    "238": {"cls": "enemys", "id": "skeletonKing"},
    "239": {"cls": "enemys", "id": "skeletonWizard"},
    "240": {"cls": "enemys", "id": "redSkeletonCaption"},
    "241": {"cls": "enemys", "id": "badHero"},
    "242": {"cls": "enemys", "id": "demon"},
    "243": {"cls": "enemys", "id": "demonPriest"},
    "244": {"cls": "enemys", "id": "goldHornSlime"},
    "245": {"cls": "enemys", "id": "redKing"},
    "246": {"cls": "enemys", "id": "whiteKing"},
    "247": {"cls": "enemys", "id": "blackMagician"},
    "248": {"cls": "enemys", "id": "silverSlime"},
    "249": {"cls": "enemys", "id": "swordEmperor"},
    "250": {"cls": "enemys", "id": "whiteHornSlime"},
    "251": {"cls": "enemys", "id": "badPrincess"},
    "252": {"cls": "enemys", "id": "badFairy"},
    "253": {"cls": "enemys", "id": "grayPriest"},
    "254": {"cls": "enemys", "id": "redSwordsman"},
    "255": {"cls": "enemys", "id": "whiteGhost"},
    "256": {"cls": "enemys", "id": "poisonZombie"},
    "257": {"cls": "enemys", "id": "magicDragon"},
    "258": {"cls": "enemys", "id": "octopus"},
    "259": {"cls": "enemys", "id": "darkFairy"},
    "260": {"cls": "enemys", "id": "greenKnight"},
    "261": {"cls": "enemy48", "id": "angel"},
    "262": {"cls": "enemy48", "id": "elemental"},
    "263": {"cls": "enemy48", "id": "steelGuard"},
    "264": {"cls": "enemy48", "id": "evilBat"},
    "265": {"cls": "enemys", "id": "vswordEmperor"},
    "266": {"cls": "items", "id": "fireDiamond"},
    "267": {"cls": "items", "id": "waterDiamond"},
    "268": {"cls": "items", "id": "metalDiamond"},
    "269": {"cls": "items", "id": "woodDiamond"},
    "270": {"cls": "items", "id": "soilDiamond"},
    "271": {"cls": "items", "id": "saintSword"},
    "272": {"cls": "items", "id": "virtualFace"},
    "273": {"cls": "items", "id": "soulSword"},
    "274": {"cls": "items", "id": "soulDiamond"},
    "275": {"cls": "items", "id": "fireSword"},
    "276": {"cls": "items", "id": "iceSword"},
    "277": {"cls": "items", "id": "bladeShield"},
    "278": {"cls": "items", "id": "vanGuard"},
    "279": {"cls": "items", "id": "leafGuard"},
    "280": {"cls": "items", "id": "tmGuard"},
    "290": {"cls": "items", "id": "memoryBook"},
    "300": {"cls": "terrains", "id": "ground"},
    "301": {"cls": "terrains", "id": "grass"},
    "302": {"cls": "terrains", "id": "grass2"},
    "303": {"cls": "terrains", "id": "snowGround"},
    "304": {"cls": "terrains", "id": "ground2"},
    "305": {"cls": "terrains", "id": "ground3"},
    "306": {"cls": "terrains", "id": "ground4"},
    "307": {"cls": "terrains", "id": "sand"},
    "308": {"cls": "terrains", "id": "ground5"},
    "309": {"cls": "terrains", "id": "yellowWall2"},
    "310": {"cls": "terrains", "id": "whiteWall2"},
    "311": {"cls": "terrains", "id": "blueWall2"},
    "312": {"cls": "terrains", "id": "blockWall"},
    "313": {"cls": "terrains", "id": "grayWall"},
    "314": {"cls": "terrains", "id": "white"},
    "315": {"cls": "terrains", "id": "ground6"},
    "316": {"cls": "terrains", "id": "soil"},
    "317": {"cls": "terrains", "id": "ground7"},
    "318": {"cls": "terrains", "id": "ground8"},
    "319": {"cls": "terrains", "id": "T319"},
    "320": {"cls": "terrains", "id": "T320"},
    "321": {"cls": "npc48", "id": "N321"},
    "322": {"cls": "npc48", "id": "N322"},
    "323": {"cls": "npc48", "id": "N323"},
    "324": {"cls": "npc48", "id": "N324"},
    "325": {"cls": "terrains", "id": "T325"},
    "326": {"cls": "terrains", "id": "T326"},
    "327": {"cls": "terrains", "id": "T327"},
    "328": {"cls": "terrains", "id": "T328"},
    "329": {"cls": "terrains", "id": "T329"},
    "330": {"cls": "terrains", "id": "T330"},
    "331": {"cls": "terrains", "id": "T331"},
    "332": {"cls": "terrains", "id": "T332"},
    "333": {"cls": "terrains", "id": "T333"},
    "334": {"cls": "terrains", "id": "T334"},
    "335": {"cls": "terrains", "id": "T335"},
    "336": {"cls": "terrains", "id": "T336"},
    "337": {"cls": "terrains", "id": "T337"},
    "338": {"cls": "terrains", "id": "T338"},
    "339": {"cls": "terrains", "id": "T339"},
    "340": {"cls": "terrains", "id": "T340"},
    "341": {"cls": "npc48", "id": "N341"},
    "342": {"cls": "enemy48", "id": "E342"},
    "343": {"cls": "npc48", "id": "N343"},
    "344": {"cls": "npc48", "id": "N344"},
    "345": {"cls": "terrains", "id": "T345"},
    "346": {"cls": "terrains", "id": "T346"},
    "347": {"cls": "terrains", "id": "T347"},
    "348": {"cls": "terrains", "id": "T348"},
    "349": {"cls": "terrains", "id": "T349"},
    "350": {"cls": "terrains", "id": "T350"},
    "351": {"cls": "terrains", "id": "T351"},
    "352": {"cls": "terrains", "id": "T352"},
    "353": {"cls": "terrains", "id": "T353"},
    "354": {"cls": "terrains", "id": "T354"},
    "355": {"cls": "terrains", "id": "T355"},
    "356": {"cls": "npc48", "id": "N356"},
    "357": {"cls": "npc48", "id": "N357"},
    "358": {"cls": "npc48", "id": "N358"},
    "359": {"cls": "npc48", "id": "N359"},
    "360": {"cls": "npc48", "id": "N360"},
    "361": {"cls": "npc48", "id": "N361"},
    "362": {"cls": "items", "id": "I362"},
    "363": {"cls": "items", "id": "I363"},
    "364": {"cls": "items", "id": "I364"},
    "365": {"cls": "items", "id": "I365"},
    "366": {"cls": "items", "id": "I366"},
    "367": {"cls": "items", "id": "I367"},
    "368": {"cls": "items", "id": "I368"},
    "369": {"cls": "items", "id": "I369"},
    "370": {"cls": "items", "id": "I370"},
    "371": {"cls": "items", "id": "I371"},
    "372": {"cls": "items", "id": "I372"},
    "373": {"cls": "items", "id": "I373"},
    "374": {"cls": "enemys", "id": "E374"},
    "375": {"cls": "enemys", "id": "E375"},
    "376": {"cls": "enemys", "id": "E376"},
    "377": {"cls": "enemys", "id": "E377"},
    "378": {"cls": "enemys", "id": "E378"},
    "379": {"cls": "enemys", "id": "E379"},
    "666": {"cls": "npc48", "id": "npc5"},
    "667": {"cls": "npc48", "id": "dljgs1"}
}
